package com.broadengate.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.broadengate.service.AdminService;

public class PoundageAction extends DispatchAction {

	private AdminService adminService;
	
	/******
	 * 将手续费率存到session中以备后面试用
	 * 核心功能由调用AdminService对象的方法findAtminfo()实现
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward 对象
	 */
	public ActionForward poundage(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response){
		
		HttpSession session=request.getSession();
		session.setAttribute("poundage",adminService.findAtminfo().getPoundage());
		return mapping.findForward("success");
	}

	public AdminService getAdminService() {
		return adminService;
	}

	public void setAdminService(AdminService adminService) {
		this.adminService = adminService;
	}
	
}
